﻿<%@ Page Title="" Language="C#" MasterPageFile="~/followerpart/followermaster.master" AutoEventWireup="true" CodeFile="HistoryOfCheckings.aspx.cs" Inherits="companypart_HistoryOfCheckings"meta:resourcekey="PageResource1" %>
<%@ Register Assembly="EO.Web" Namespace="EO.Web" TagPrefix="eo" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
    tr .tabbone4{
	 background-color:#028ac5;
	 font-size:11px;
	 line-height:20px;
	 font-family:Tahoma;
  	 color:#fff;
  	 text-align:right;
	
}
.adel4{
	background-color:#ededed;
	font-size:10px;
	color:#084f86;
	font-family:Tahoma;
	height:30px;
	text-align:  right;
}
         .zr3 {
	background-image:url('../images/button2.png');
	display:block;
	float:right;
	 padding: 0px 10px 0px 10px;
	height:21px;
	text-align:center;
	color:#fff;
	text-shadow:1px 1px 0px #003a5e;
	margin-right:2px;
	line-height:19px;
	font-weight:bold;
	text-decoration:none;
	font-family:Tahoma;
	font-size:12px;


}
.zr3:hover ,.zr3:active {
	background-image:url('../images/button2.png');
	text-shadow:1px 1px 0px #003a5e;
	background-position:0px -21px;
	
}
  .stylelabel3
       {
       	color:#064c66;
	 font-weight:bold;
	 direction:rtl;
	 text-align:right;
       	}
             .tab3{
	width:815px;
 direction:rtl;
 border:1px #ccc solid;
 border-radius:5px;
 }

tr .tabbone3{
	 background-color:#028ac5;
	 font-size:11px;
	 line-height:20px;
	 font-family:Tahoma;
  	 color:#fff;
  	 text-align:center;
	
}
 .req3
       {
           color:Red;
       } 
.adel3{
	background-color:#ededed;
	font-size:10px;
	color:#084f86;
	font-family:Tahoma;
	height:30px;
	text-align:  center;
}
.he3{
	background-color:#fff;
	padding:5px;
	font-family:Tahoma;
	font-size:14px;
	font-weight:bold;
}
.txt3
{
    border:1px solid black;
    }
        .jqmWindow {
    display: none;
    
    position: fixed;
    top: 17%;
    left: 50%;
    
    margin-left: -300px;
    width: 800px;
    
    background-color: #EEE;
    color: #333;
    border: 1px solid black;
    padding: 12px;
}

        .lok
     {
	display: none;
	color: red;
     }
       
}
    </style>
    <script src="../jquery-1.3.2.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $('#<%=DropDownList1.ClientID%>').change(function () {
                var selectedVal = $('#<%=DropDownList1.ClientID%> option:selected').attr('value');
                if (selectedVal == '0') {

                    $('#<%=RadioButtonList1.ClientID%>_1').attr('checked', 'checked');
                    $('#<%=RadioButtonList1.ClientID%>_0').attr('disabled', 'disabled');
                    $('#<%=RadioButtonList1.ClientID%>_1').attr('disabled', 'disabled');

                }
                else {

                    $('#<%=RadioButtonList1.ClientID%>_1').attr('checked', '');
                    $('#<%=RadioButtonList1.ClientID%>_0').attr('disabled', '');
                    $('#<%=RadioButtonList1.ClientID%>_1').attr('disabled', '');
                }

            })
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">



   <%-- <asp:UpdatePanel ID="UpdatePanel1" runat="server" ChildrenAsTriggers="true">
    <ContentTemplate>--%>
   <br />
 <div id="main" runat="server" dir="rtl">
 
 <table class="tab3">
  <tr class="tabbone3">
  <td class="tabbone3">

    <asp:Label  ID="pro" runat="server" Text="اسم الدورية او المجلة" meta:resourceKey="pro" ></asp:Label>
    </td>
    
  
  </tr>
  <tr class="adel3">
  <td class="adel3">
    <asp:DropDownList ID="currentsubs" runat="server" DataSourceID="SqlDataSource2"  class="txt3" DataTextField="product"
        DataValueField="mysub" AutoPostBack="true" 
        onselectedindexchanged="currentsubs_SelectedIndexChanged" 
            AppendDataBoundItems="True">
        <asp:ListItem Value="0">--</asp:ListItem>
    </asp:DropDownList>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        SelectCommand="select p.* ,t.id as mysub from  products p  INNER JOIN company_product t ON (t.product_id = p.id)   WHERE t.company_id = @company_id  ">
        <SelectParameters>
            <asp:SessionParameter Name="company_id" SessionField="company_id" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    </td>
  </tr>
  </table>
</div>


<div id="details" runat="server" visible="false">
<table class="tab3">
<tr>
<td class="he3" colspan="3"> <asp:Label   ID="filter" runat="server" 
                     Text="فلترة" meta:resourceKey="filter" /></td>
</tr>
<tr >
<td class="tabbone3">
    <asp:Label   ID="lblsatrtsub" runat="server" Text="من" meta:resourceKey="lblsatrtsub" />
</td>
<td class="tabbone3">
    <asp:Label   ID="lblendsub" runat="server" Text="الى" meta:resourceKey="lblendsub" />
</td>
<td class="tabbone3">
    <asp:Label ID="followinglabel" runat="server" Text="متابعة" meta:resourceKey="followinglabel"></asp:Label>
</td>
<td class="tabbone3"> 
    <asp:Label   ID="Label2" runat="server" Text="تم الاستلام" meta:resourceKey="receive" />
</td>
</tr>
<tr>
<td class="adel3">
        <eo:datepicker ID="DatePicker1" runat="server" DayHeaderFormat="Full" 
               DayCellHeight="16" DisabledDates="" TitleLeftArrowImageUrl="DefaultSubMenuIconRTL"
                                    OtherMonthDayVisible="True" DayCellWidth="19" TitleRightArrowImageUrl="DefaultSubMenuIcon"
                                    ControlSkinID="None" SelectedDates="">
                                    <DayHoverStyle CssText="font-family: tahoma; font-size: 12px; border-right: #fbe694 1px solid; border-top: #fbe694 1px solid; border-left: #fbe694 1px solid; border-bottom: #fbe694 1px solid">
                                    </DayHoverStyle>
                                    <TitleStyle CssText="background-color:#9ebef5;font-family:Tahoma;font-size:12px;padding-bottom:2px;padding-left:6px;padding-right:6px;padding-top:2px;">
                                    </TitleStyle>
                                    <DayHeaderStyle CssText="font-family: tahoma; font-size: 12px; border-bottom: #aca899 1px solid">
                                    </DayHeaderStyle>
                                    <DayStyle CssText="font-family: tahoma; font-size: 12px; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid">
                                    </DayStyle>
                                    <SelectedDayStyle CssText="font-family: tahoma; font-size: 12px; background-color: #fbe694; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid">
                                    </SelectedDayStyle>
                                    <TitleArrowStyle CssText="cursor:hand"></TitleArrowStyle>
                                    <TodayStyle CssText="font-family: tahoma; font-size: 12px; border-right: #bb5503 1px solid; border-top: #bb5503 1px solid; border-left: #bb5503 1px solid; border-bottom: #bb5503 1px solid">
                                    </TodayStyle>
                                    <PickerStyle CssText="border-bottom-color:#7f9db9;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#7f9db9;border-left-style:solid;border-left-width:1px;border-right-color:#7f9db9;border-right-style:solid;border-right-width:1px;border-top-color:#7f9db9;border-top-style:solid;border-top-width:1px;font-family:Courier New;font-size:8pt;margin-bottom:0px;margin-left:0px;margin-right:0px;margin-top:0px;padding-bottom:1px;padding-left:2px;padding-right:2px;padding-top:2px;">
                                    </PickerStyle>
                                    <OtherMonthDayStyle CssText="font-family: tahoma; font-size: 12px; color: gray; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid">
                                    </OtherMonthDayStyle>
                                    <CalendarStyle CssText="background-color: white; border-right: #7f9db9 1px solid; padding-right: 4px; border-top: #7f9db9 1px solid; padding-left: 4px; font-size: 9px; padding-bottom: 4px; border-left: #7f9db9 1px solid; padding-top: 4px; border-bottom: #7f9db9 1px solid; font-family: tahoma">
                                    </CalendarStyle>
                                    <DisabledDayStyle CssText="font-family: tahoma; font-size: 12px; color: gray; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid">
                                    </DisabledDayStyle>
                                    <MonthStyle CssText="font-family: tahoma; font-size: 12px; margin-left: 14px; cursor: hand; margin-right: 14px">
                                    </MonthStyle>
                                </eo:datepicker>
</td>
<td class="adel3">
    <eo:DatePicker ID="DatePicker2" runat="server" ControlSkinID="None" 
        DayCellHeight="16" DayCellWidth="19" DayHeaderFormat="Full" DisabledDates="" 
        OtherMonthDayVisible="True" SelectedDates="" 
        TitleLeftArrowImageUrl="DefaultSubMenuIconRTL" 
        TitleRightArrowImageUrl="DefaultSubMenuIcon">
        <DayHoverStyle CssText="font-family: tahoma; font-size: 12px; border-right: #fbe694 1px solid; border-top: #fbe694 1px solid; border-left: #fbe694 1px solid; border-bottom: #fbe694 1px solid" />
        <TitleStyle CssText="background-color:#9ebef5;font-family:Tahoma;font-size:12px;padding-bottom:2px;padding-left:6px;padding-right:6px;padding-top:2px;" />
        <DayHeaderStyle CssText="font-family: tahoma; font-size: 12px; border-bottom: #aca899 1px solid" />
        <DayStyle CssText="font-family: tahoma; font-size: 12px; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
        <SelectedDayStyle CssText="font-family: tahoma; font-size: 12px; background-color: #fbe694; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
        <TitleArrowStyle CssText="cursor:hand" />
        <TodayStyle CssText="font-family: tahoma; font-size: 12px; border-right: #bb5503 1px solid; border-top: #bb5503 1px solid; border-left: #bb5503 1px solid; border-bottom: #bb5503 1px solid" />
        <PickerStyle CssText="border-bottom-color:#7f9db9;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#7f9db9;border-left-style:solid;border-left-width:1px;border-right-color:#7f9db9;border-right-style:solid;border-right-width:1px;border-top-color:#7f9db9;border-top-style:solid;border-top-width:1px;font-family:Courier New;font-size:8pt;margin-bottom:0px;margin-left:0px;margin-right:0px;margin-top:0px;padding-bottom:1px;padding-left:2px;padding-right:2px;padding-top:2px;" />
        <OtherMonthDayStyle CssText="font-family: tahoma; font-size: 12px; color: gray; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
        <CalendarStyle CssText="background-color: white; border-right: #7f9db9 1px solid; padding-right: 4px; border-top: #7f9db9 1px solid; padding-left: 4px; font-size: 9px; padding-bottom: 4px; border-left: #7f9db9 1px solid; padding-top: 4px; border-bottom: #7f9db9 1px solid; font-family: tahoma" />
        <DisabledDayStyle CssText="font-family: tahoma; font-size: 12px; color: gray; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
        <MonthStyle CssText="font-family: tahoma; font-size: 12px; margin-left: 14px; cursor: hand; margin-right: 14px" />
    </eo:DatePicker>
</td>

<td class ="adel3">

    <asp:DropDownList ID="DropDownList1" CssClass="txt3"   runat="server" AppendDataBoundItems="True" 
        DataSourceID="SqlDataSource3" DataTextField="follower_name" 
        DataValueField="user_id">
        <asp:ListItem   Value="0" Text='<%$ Resources:Resource, notfollowed %>'></asp:ListItem>
        <asp:ListItem   Value="" Text='<%$ Resources:Resource, byme %>'></asp:ListItem>

    </asp:DropDownList>
    
    <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        SelectCommand="SELECT user_id, company_id, follower_name FROM companysubadmins WHERE (company_id = @company_id)">
        <SelectParameters>
            <asp:SessionParameter Name="company_id" SessionField="company_id" />
        </SelectParameters>
    </asp:SqlDataSource>
    
</td>
<td class="adel3">
      <asp:RadioButtonList ID="RadioButtonList1" runat="server" TextAlign="right"  >
                  
                    <asp:ListItem style="float:right" Text="تم الاستلام" Value="1" 
                        meta:resourceKey="receive" Enabled="False"></asp:ListItem>
                    <asp:ListItem style="float:right" Text="لم يتم الاستلام" Value="0" 
                        meta:resourceKey="noreceive" Enabled="False" ></asp:ListItem>
                </asp:RadioButtonList>
</td>
</tr>
</table>
<table>
<tr>
<td>
           <asp:Button  ID="save"  CssClass="zr3" runat="server" Text="اضغط" 
               meta:resourceKey="press" onclick="save_Click" />
    </td>
</tr>
</table>
          <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
                    DataSourceID="SqlDataSource1" 
                    OnRowCreated="GridView1_RowCreated"
                    AllowPaging="True" onrowdatabound="GridView1_RowDataBound" 
        EnableModelValidation="True" ondatabound="GridView1_DataBound" 
        GridLines="None"  >
                    <PagerSettings FirstPageText="الاولى" LastPageText="الاخيرة"
                        NextPageText="التالى" PreviousPageText="السابق" />
                    <Columns>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                <div >
                                    <table class="tab3">
                                        <tr class="tabbone3">
                                         
                                            <td  style="width:100px">
                                                <asp:Label ID="checked" runat="server" Text="تاريخ المراجعة " meta:resourceKey="checked"
                                                    />
                                            </td>
                                             <td style="width:100px">
                                                <asp:Label ID="delivered" runat="server" Text="تم الاستلام " meta:resourceKey="delivered"
                                                    />
                                            </td>
                                            <td style="width:100px">
                                                <asp:Label ID="lblpadfees" runat="server" Text="ميعاد الاستلام " meta:resourceKey="lblsupposeddate"
                                                     />
                                            </td>
                                            
                                            <td style="width:100px">
                                                   <asp:Label ID="label" runat="server" Text="قيمة النسخة" meta:resourceKey="lblpaidfees"
                                                    />
                                            </td>
                                            <td style="width:100px">
                                                <asp:Label ID="lblissn" runat="server" Text="عدد النسخ " meta:resourceKey="lblcopyno"
                                                    />
                                            </td>
                                             <td style="width:100px">
                                                <asp:Label ID="Label6" runat="server" Text="عدد النسخ " meta:resourceKey="lblcopyno"
                                                     />
                                            </td>
                                           <td style="width:100px">
                                                <asp:Label ID="Label1" runat="server" Text="المستخدم" meta:resourceKey="user"
                                                    />
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <table class="tab3">
                                    <tr class="adel3">
                                    
                                    <td style="width:100px">
                                        <asp:HiddenField ID="proid" runat="server" Value='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("pro"))) %>' />
                                        <asp:HiddenField ID="start" runat="server" Value='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("startdate"))) %>' />
                                       
                                    
                                            <asp:Label ID="Label5" runat="server" Text='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("datechecked"))) %>'
                                                />
                                        </td>
                                        <td style="width:100px">
                                            <%--<asp:Label  ID="del" runat="server" Text='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("delivered"))) %>'
                                                 />--%>
                                                 <img  width="22px" height="22px" alt='<%# (bool)Eval("delivered")==true? "Yes":"NO"  %>' src='<%# (bool)Eval("delivered")==true? "../images/true.png":"../images/false.png"  %>' />
                                        </td>
                                        <td style="width:100px">
                                            <asp:Label  ID="issuedate" runat="server" Text='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("issuedate"))) %>'
                                                 />
                                        </td>
                                        
                                        <td style="width:100px">
                                            <asp:Label  ID="price" runat="server" Text='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("copyprice"))) %>'
                                                 />
                                        </td>
                                        <td style="width:100px">
                                            <asp:Label  ID="Label8" runat="server" Text='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("copyno"))) %>'
                                                 />
                                        </td>
                                        <td style="width:100px">
                                            <asp:Label  ID="no" runat="server" Text='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("receivedcopy"))) %>'
                                                 />
                                        </td>
                                       <td style="width:100px">
                                            <asp:Label  ID="Label4" runat="server" Text='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("username"))) %>'
                                                 />
                                        </td>
                                    </tr>
                                </table>
                            </ItemTemplate>
                        </asp:TemplateField>
                   
                    <%--    <asp:TemplateField >
                            <HeaderTemplate>
                           
                              <asp:Label ID="Label10" runat="server" Text="متابعة" meta:resourceKey="lblshow" />
                            
                          
                            </HeaderTemplate>
                            <ItemTemplate>
                           
                                <asp:LinkButton ID="aore" runat="server" AutoPostBack="true" OnClick="aore_Click" ToolTip='<%# String.Format("{0} , {1},{2}", Eval("mysub"), Eval("distributer_id"), Eval("publisher_id")) %>'   meta:resourceKey="lblshow"></asp:LinkButton>
                            
                       
                            </ItemTemplate>
                        </asp:TemplateField>--%>
                    </Columns>
                </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        SelectCommand="select d.*,t.* ,u.username,d.id as mysub,t.product_id as pro  from users u Right outer JOIN  daily_checking d  ON (d.user_id = u.id)  INNER JOIN company_product t ON (d.company_product_id = t.id)   WHERE  t.id= @mysub  ">
        <SelectParameters>
            <asp:Parameter Name="mysub" />
        </SelectParameters>
    </asp:SqlDataSource>
    <div>
    <table dir="rtl">
    <tr>
    <td style="padding:5px;">
        <asp:Label CssClass="stylelabel3"  ID="Label3" runat="server" Text="اجمالى عدد النسخ التى تم استلامها خلال الفترة" meta:resourceKey="arrive" />
    </td>
    <td style="padding:5px;"></td>
    <td style="padding:5px;">
        <asp:Label CssClass="stylelabel3"  ID="arrive" runat="server" Text=""  />
    </td>
    
    </tr>
    <tr>
    <td style="padding:5px;"> <asp:Label CssClass="stylelabel3"  ID="Label7" runat="server" Text="اجمالى عدد النسخ التى لم يتم استلامها خلال الفترة" meta:resourceKey="noarrive" /></td>
    <td style="padding:5px;"></td>
    <td style="padding:5px;"> <asp:Label CssClass="stylelabel3"  ID="noarrive" runat="server" Text=""  /></td>
   
    </tr>
    <tr>
    <td style="padding:5px;"> <asp:Label CssClass="stylelabel3"  ID="Label9" runat="server" 
            Text="اجمالى عدد النسخ التى لم يتم متابعتها" 
            meta:resourceKey="notcheckeditemsLabel" /> </td>
   <td style="padding:5px;">&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;</td>
    <td style="padding:5px;"> <asp:Label CssClass="stylelabel3"  
            ID="NotCheckedItems" runat="server" Text=""  /></td>
    </tr>
    </table>
    </div>
    <div align="center">
     <table  class="tables" dir="rtl">
     
     <tr>
   
   
   <td> <asp:Button ID="ints" CssClass="zr3" runat="server" Text="" meta:resourceKey="intcheck"  onclick="ints_Click"  /></td>
    <td>
    
        <asp:Button ID="pressed" CssClass="zr3" runat="server" Text="انشىء تقرير" meta:resourcekey="createreport"
            onclick="LinkButton1_Click" />
            </td>
    </tr>
    </table>
    </div>
    
    </div>
   <%-- </ContentTemplate>
 <Triggers>
 <asp:PostBackTrigger ControlID="save" />
 <asp:AsyncPostBackTrigger ControlID="currentsubs" EventName="SelectedIndexChanged" />
 
 </Triggers>
    </asp:UpdatePanel>--%>
</asp:Content>

